package com.tensquare.spit.dao;

import com.tensquare.spit.pojo.Spit;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * dao接口
 */
public interface SpitDao extends MongoRepository<Spit,String> {
    //根据方法命名规则查询
    List<Spit> findByParentidIsNull();

    //查询评论
    Page<Spit> findByParentid(String parentid, Pageable of);
}
